package com.zhgxi.zf.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.slave4j.orm.hibernate.BaseEntity;

@Entity
@Table(name = "zf_user")
public class User extends BaseEntity {

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "did")
	private Dept dept;
	
	@Column(name = "username", nullable = false, length = 16)
	private String username;
	
	@Column(name = "password", nullable = false, length = 16)
	private String password;
	
	@Column(name = "phone", length = 50)
	private String phone;
	
	@Column(name = "email", length = 100)
	private String email;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "rid", nullable = false)
	private Role role;

	public User() {
	}

	public Dept getDept() {
		return dept;
	}

	public void setDept(Dept dept) {
		this.dept = dept;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

}